export const shuffle = function(list){
    let arr=list.slice()
    for(let i= 0;i<arr.length; i++){
        let random=randoma(0,i)
        let j=arr[i]
        arr[i]=arr[random]
        arr[random]=j       
    }
    return arr
}
function randoma(min,max){
    return Math.floor(Math.random()*(max-min+1)+min)
}

//节流-----
export const debounce=function(func,delay) {
    let timer
    
    return function(...args){
        if (timer) {
            clearTimeout(timer)
        }
        timer=setTimeout(()=> {
            func.apply(this, args)
        },delay)
    }
}